<template>
  <div>
    <!--热门榜单-->
      <div class="hot-header">
          <img src="http://img1.qunarzz.com/piao/fusion/1711/16/bfbb9874e8f11402.png">
          <p>热门榜单</p></div>
      <div class="hot-comment">
          <ul>

                <swiper :options="swiperOption">
                  <swiper-slide v-for="item of list" :key="item.id">
                    <router-link :to="'/detail/' + item.id">
                      <li >
                          <img :src="item.recommedUrl">
                          <p v-text="item.title"></p>
                          <p><span>{{item.spice}}</span>起</p>
                       </li>
                    </router-link>
                  </swiper-slide>
                  <div class="swiper-pagination" slot="pagination"></div>
                </swiper>

          </ul>
      </div>
      <div class="hot-header">
    <img src="http://img1.qunarzz.com/piao/fusion/1711/89/ebc329f16c55bb02.png">
    <p>猜你喜欢</p>
    </div>
      <div class="hot-list">
        <ul>
          <router-link
            tag="li"
            v-for="progress of hotlist"
            :key="progress.id"
            :to="'/detail/' + progress.id"
          >
            <div class="hot-listImg">
              <img :src="progress.hotListUrl">
            </div>
            <div class="hot-listInfo" >
                <div class="hot-listArea">{{progress.hotListArea}}</div>
                <div class="hot-listComment">
                  <img src="../../../../static/images/start.png" />
                  <span>{{progress.hotListConmentNum}}评论</span>
                </div>
                <div class="hot-listPrice">
                  <span>￥{{progress.hotListPrice}}起</span>
                  <span>{{progress.hotListposition}}</span>
                </div>
            </div>
          </router-link>
        </ul>
      </div>
    <div class="hot-listMore">查看所有产品</div>
  </div>

</template>
<script>
export default {
  name: 'HomeRecommed',
  props: {
    list: Array,
    hotlist: Array
  },
  data() {
    return {
      swiperOption: {
        slidesPerView: 5,
        spaceBetween: 30,
        freeMode: true,
        pagination: {
          el: '.swiper-pagination',
          clickable: true
        }
      }
    }
  }
}
</script>
<style scoped>
  .hot-header {
    height: 25px;
    width: 100%;
    background-color:rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
  }
  .hot-header img {
    margin-left: 10px;
    margin-top:5px;
    width: 15px;
    height: 15px;
  }
  .hot-header p{
    position: absolute;
    top:0;
    left:30px;
    line-height: 25px;
  }
  .hot-comment {
    width: 100%;
    height: 130px;
    overflow: hidden;
  }
  .hot-comment ul {
     width:140%;

  }
  .hot-comment ul li{
    list-style: none;
    width:100px;
    height: 130px;
    background-color: bisque;
    margin-right: 5px;
    float: left;
  }
  .hot-comment ul li img {
    width:100px;
    height: 100px;
  }
  .hot-comment ul li p{
    color:black;
    font-size: 10px;
    text-align: center;
    margin-top: 1px;
  }
  .hot-comment ul li p span {
    color: red;
  }
  .hot-list {
    width: 100%;
    overflow: hidden;
  }
  .hot-list ul li{
    list-style: none;
    margin-top: 10px;
    height: 100px;
    box-shadow: -1px 2px 4px #7e8c8d;

  }
  .hot-list  .hot-listImg {
    float: left;
  }
  .hot-list ul li .hot-listImg>img{
    width:100px;
    height: 100px;
    margin-left: 10px;
  }
  .hot-list .hot-listInfo {
   height: 100px;
   margin-left: 120px;
  }
  .hot-list .hot-listInfo .hot-listArea {
    color: black;
    font-weight: bold;
    margin-left: 10px;
    margin-top: 5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

  }
  .hot-listInfo .hot-listComment {
    margin-top: 15px;
  }
  .hot-listInfo .hot-listComment>img {
    margin-top: 2px;
  }
  .hot-listInfo .hot-listComment >span {
    margin-left: 30px;
    font-size: 12px;
    color: #7e8c8d;
    line-height: 14px;
  }
  .hot-listInfo .hot-listPrice {
    margin-top:25px;
  }
  .hot-listInfo .hot-listPrice span:first-child {
    color: red;
  }
  .hot-listInfo .hot-listPrice span:last-child {
    float:right;
    font-size: 13px;
    margin-right: 5px;
  }
  .hot-listMore {
    width:100%;
    height: 40px;
    background-color: green;
    line-height: 40px;
    font-size: 20px;
    text-align: center;
  }
</style>
